﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework.Db;
using System.Collections.Specialized;
using System.Data;
using Framework.Kit;
using System.Collections;

namespace BLL.Service
{

    /// <summary>
    /// 终端服务
    /// </summary>
    public class terminalService : DbBase
    {
        public readonly static Hashtable htSeatIp = new Hashtable();

        // 获取终端列表
        public void SetTerminalMap()
        {
            try
            {
                List<Model.terminalModel> lstTerminal = new List<Model.terminalModel>();
                string sql = string.Format("SELECT * FROM teminal");
                DataTable dt = queryDtSQL(sql);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["IPADDRESS"] != null && htSeatIp.ContainsKey(dt.Rows[i]["IPADDRESS"]) == false)
                    {
                        htSeatIp.Add(dt.Rows[i]["IPADDRESS"].ToString(), dt.Rows[i]["SEATNUMBER"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                other.WriteErrLog("获取终端列表信息", ex);
            }
        }
    }
}